/*
 * @Author: xianfuyou
 * @Date: 2022-04-05 18:02:50
 * @LastEditors: your name
 * @LastEditTime: 2022-04-07 11:39:49
 * @Description: file content
 */
import React, { useEffect, useState } from 'react'
import { Modal, Image, Row, Col } from 'antd'
import './css/Model.css'

export default function ViewImage(props) {
  const { isShow, pHandleCancel, nowImage } = props
  // 当前显示图片
  const [nowImageInfo, setNowImageInfo] = useState(nowImage)

  console.log(nowImage)

  useEffect(() => {
    setNowImageInfo(nowImage)
  }, [nowImage])

  const handleCancel = () => {
    pHandleCancel(false);
  };

  return (
    <div>
      <Modal
        className="xfy_dep_add_modal image_info"
        title="查看附件"
        footer={null}
        onCancel={handleCancel}
        visible={isShow}
        destroyOnClose={true}
        forceRender={true}
      >
        <Row justify={'center'}>
          <Col>
            <Image
              width={600}
              src={nowImageInfo}
              preview={false}
            />
          </Col>
        </Row>
      </Modal>
    </div>
  )
}
